GPSBabel [Thu, 4 Jun 2020 07:46:11 +0000 (02:46 -0500)]
Remove Mapsource .mps format (#588)
* Fix numerous instances of shadowing confusion.
Inspired by a cppcon talk and our recent conversations about warnings, I
took a closer look at shadowing variables in our code and I wasn't proud
of my findings.
We had a lot of code that was writing to local variables or function
arguments when it thought it was operating on globals or (soon)
method-member variables. I made a rather half-hearted pass at changing
this by splitting up huge functions, renaming arguments, renaming globals
to reflect their future status as method variables (foo_), and generally
cleaning things up. The amound of effort I spent on each format was
approximately equal to its expected lifespan - I'm not spending an hour
on cleanups on formats I should instead be deleting.
In a future submit, I'll try to find some combination of -W flags on
our targets that allows us to not regress easily.
* Fix merge conflict I just created in gdb.cc
* Delete workspace.xml
* Delete the same link in garmin_icons.xml that I deleted twice yesterday.
Fix more esoteric warnings.
* Reapply MORE of yesterday's commits.
Seriously, I know this has been committed and is in HEAD...
* Attempt to fix list detachment within route.cc
* Remove Mapsource
The Mapsource format has been deprecated by Garmin for something
like 15 years. Later versions of Mapsource used GDB and Basecamp,
Garmin's first replacement for the Mapsource lineage, was used
exclusively in later versions.
I've reviewed list traffic and floated a discussion on the list.
The code style was never really very flexible and it it bears
a high maintenance cost that we can no longer afford. This
format is dead.
* Remove more pieces of Mapsource.
* Change Netstumbler test to not use Mapsource for staging.
More cleanups.
* Fix netstumbler so I can delete Mapsource. Ugh.
* Update netstumbler with IWYU.
tsteven4 [Wed, 3 Jun 2020 11:11:04 +0000 (05:11 -0600)]
use http for upgrade (#587)
* test "TLS initialization failed" issue on windows.
* https ok with desktop services.
tsteven4 [Mon, 1 Jun 2020 20:50:26 +0000 (14:50 -0600)]
fix Qt 5.15.0 Wdeprecated-declarations warnings for (#584)
QXmlDefaultHandler
QXmlInputSource
QXmlSimpleReader
as suggested use QXmlStreamReader instead.
tsteven4 [Mon, 1 Jun 2020 20:49:29 +0000 (14:49 -0600)]
convert osm to format class (#579)
* convert osm to Format class.
* use static function cb w/o lambdas.
tsteven4 [Mon, 1 Jun 2020 18:55:10 +0000 (12:55 -0600)]
clean up mkstyle.sh (#578)
as suggested by shellcheck used $() instead of backticks,
and double quote to prevent globbing and word splitting.
mkstyle.sh now works if the directory path contains a space.
drop the failed attempt to exclude custom.style. This resolves #577
drop the exclusion of README.style, which hasn't existed for a long time.
use basename to drop the suffix instead of piping to sed.
tsteven4 [Mon, 1 Jun 2020 11:26:31 +0000 (05:26 -0600)]
fix Qt 5.15.0 Wdeprecated-declarations warnings for (#583)
QTime::start()
QTime::elapsed()
tsteven4 [Mon, 1 Jun 2020 11:18:49 +0000 (05:18 -0600)]
make garmin_tables const (#576)
and clean up mkicondoc cppcheck errors.
tsteven4 [Thu, 28 May 2020 14:22:47 +0000 (08:22 -0600)]
Merge pull request #574 from tsteven4/guict
clang-tidy fixes for GUI
tsteven4 [Wed, 27 May 2020 20:37:09 +0000 (14:37 -0600)]
clang-tidy readability-isolate-declaration on gui.
tsteven4 [Wed, 27 May 2020 20:31:23 +0000 (14:31 -0600)]
clang tidy modernize-use-auto on gui.
tsteven4 [Wed, 27 May 2020 20:27:20 +0000 (14:27 -0600)]
clang tidy modernize-redundant-void-arg on gui.
tsteven4 [Wed, 27 May 2020 19:48:15 +0000 (13:48 -0600)]
clang-tidy readability-redundant-member-init on gui.
GPSBabel [Wed, 27 May 2020 03:31:16 +0000 (22:31 -0500)]
Fix numerous instances of shadowing confusion. (#570)
Fix numerous instances of shadowing confusion.
Inspired by a cppcon talk and our recent conversations about warnings, I
took a closer look at shadowing variables in our code and I wasn't proud
of my findings.
We had a lot of code that was writing to local variables or function
arguments when it thought it was operating on globals or (soon)
method-member variables. I made a rather half-hearted pass at changing
this by splitting up huge functions, renaming arguments, renaming globals
to reflect their future status as method variables (foo_), and generally
cleaning things up. The amound of effort I spent on each format was
approximately equal to its expected lifespan - I'm not spending an hour
on cleanups on formats I should instead be deleting.
In a future submit, I'll try to find some combination of -W flags on
our targets that allows us to not regress easily.
tsteven4 [Mon, 25 May 2020 17:52:58 +0000 (11:52 -0600)]
Fail configuration if libusb-1.0 is not found (#564)
* have configure fail if libusb is enabled and not found.
* correct indentation in configure.
Jochen Sprickerhof [Mon, 25 May 2020 15:08:13 +0000 (17:08 +0200)]
Use strncmp to compare array to string (#545)
tsteven4 [Mon, 25 May 2020 11:55:37 +0000 (05:55 -0600)]
fix -Wsizeof-pointer-memaccess in garmin_gpi reader. (#569)
again, this really wasn't a problem. The destination and the
source had the same size. But we can do better.
GPSBabel [Mon, 25 May 2020 07:51:01 +0000 (02:51 -0500)]
Merge pull request #567 from gpsbabel/bye_psitrex
Remove PSITrex, which has been unused for many years.
Robert Lipe [Mon, 25 May 2020 04:09:25 +0000 (23:09 -0500)]
Merge branch 'bye_psitrex' of https://github.com/gpsbabel/gpsbabel into bye_psitrex
Robert Lipe [Mon, 25 May 2020 03:42:29 +0000 (22:42 -0500)]
Don't refer to PSITtext in reference files.
Robert Lipe [Mon, 25 May 2020 03:40:55 +0000 (22:40 -0500)]
More remnants of PSITrex.
Robert Lipe [Mon, 25 May 2020 03:38:11 +0000 (22:38 -0500)]
Garmin_icons in doc can't refer to psitrex any longer.
GPSBabel [Mon, 25 May 2020 03:34:35 +0000 (22:34 -0500)]
Cleanup of PSITrex removal
GPSBabel [Mon, 25 May 2020 03:34:16 +0000 (22:34 -0500)]
Cleanup of PSITrex removal
GPSBabel [Mon, 25 May 2020 03:33:46 +0000 (22:33 -0500)]
Cleanup of PSITrex removal
GPSBabel [Mon, 25 May 2020 03:31:53 +0000 (22:31 -0500)]
Actually prepare PSITrex deletion for cleanup
tsteven4 [Mon, 25 May 2020 01:31:08 +0000 (19:31 -0600)]
fix -Wstringop-truncation warning in osm. (#568)
tsteven4 [Sun, 24 May 2020 16:39:01 +0000 (10:39 -0600)]
teach gdb reader to read autoroute information. (#566)
Robert Lipe [Sun, 24 May 2020 07:00:48 +0000 (02:00 -0500)]
Remove PSITrex, which has been unused for many years.
CC moved to deprecated. The rest was really removed.
tsteven4 [Sat, 23 May 2020 21:36:29 +0000 (15:36 -0600)]
fix a few -Wstringop-truncation warnings (#565)
* fix -Wstringop-truncation warning in bushnell.
* fix -Wstringop-truncation in alantrl.
* fix -Wstringop-truncation warning in garmin, and a real error.
The real error:
In garmin.cc route_hdr_pr would fail to terminate the
GPS_SWay rte_ident member if latin1 encoded route name was longer
than 255 characters. Subsequently garmin.cc route_write passes the
GPS_SWay structure to GPS_Command_Send_Route. GPS_Command_Send_Route
may call GPS_A20[01]_Send which may call GPS_D202_Send. GPS_D202_Send
assumes that rte_ident is null terminated.
The other change only silences the warning, the character array was
subsequently terminated anyway.
* fix -Wstringop-truncation warning in enigma.
These are nonstrings. They are not required to be null terminated.
A real reference file caputred from MGL Central 2.0 is added. In it
you can see that don't care values are not all filled with a particular
value. We fill them with NULLs are a result of zeroing the structure before
we write it. You can also see the 1000m offset in altitudes is correct.
* correct reference file mode.
* fix two strncpy warnings that gcc 9.3.0 doesn't issue.
Perhaps it is a gcc bug that these didn't cause warnings. It seems
to be related to the fact they were the last member in the structure.
In any event, we can copy 1 byte less, we explicitly add a terminator
subsequently.
Robert Lipe [Wed, 20 May 2020 23:43:25 +0000 (18:43 -0500)]
README.md lint cleanups.
tsteven4 [Wed, 20 May 2020 16:17:55 +0000 (10:17 -0600)]
let clang-tidy provide default member initializers (#562)
* let clang-tidy provide default memeber intializers
This is the check cppcoreguidelines-pro-type-member-init, but
it was only applied to the class declarations for our filters,
formats and vectors.
This is currently irrelevant as all these are constructed globally,
but if one constructs dynamic instances errors can be seen in gpx, kml, nmea
and lowranceusr formats.
* revert filter_vecs change which MSVC 2015 choked on.
Robert Lipe [Wed, 20 May 2020 00:21:32 +0000 (19:21 -0500)]
Clarify doc on merge filter for #407.
Robert Lipe [Wed, 20 May 2020 00:09:25 +0000 (19:09 -0500)]
Maggeo source doesn't use xmlgeneric. Delete include.
Robert Lipe [Wed, 20 May 2020 00:07:53 +0000 (19:07 -0500)]
Add redundant colon.
Robert Lipe [Wed, 20 May 2020 00:05:25 +0000 (19:05 -0500)]
Promote GPX examples in doc from simplelist to listitem.
tsteven4 [Tue, 19 May 2020 14:26:55 +0000 (08:26 -0600)]
quiet some codacy yammering about thrid party files. (#561)
tsteven4 [Tue, 19 May 2020 13:12:10 +0000 (07:12 -0600)]
clean up cppcheck errors, warnings (#560)
* fix globalsat_sport cppcheck warnings.
* fix cppcheck warings in energympro.
* fix cppcheck ctunullpointer errors.
* fix cppcheck "error: Unmatched '}'" in shape.h.
* fix format string mismatches.
* fix cppcheck errors in tef_xml.
* fix cppcheck error in alan.
tsteven4 [Fri, 15 May 2020 22:16:42 +0000 (16:16 -0600)]
add dg200 test. (#558)
tsteven4 [Fri, 15 May 2020 15:04:10 +0000 (09:04 -0600)]
update shapelib to 1.5.0. (#559)
tsteven4 [Thu, 14 May 2020 17:19:24 +0000 (11:19 -0600)]
convert dg100 to Format class (#557)
* convert dg100 format to Format class.
* regenerate dependencies for dg100 format.
* whitespace
tsteven4 [Wed, 13 May 2020 15:01:50 +0000 (09:01 -0600)]
use qdatetime for dg100 format (#556)
* use QDateTime for dg-100 format.
* fix undefined behavior bug in dg100.
When sending the getconfig command memcpy would be invoked with
src == nullptr. The behavior of memcpy is undefined under these conditions,
even if the count is zero as it is in this case.
tsteven4 [Wed, 13 May 2020 13:22:58 +0000 (07:22 -0600)]
Add regression test capability for DG100/DG200 format. (#554)
* add regression test cabability for dg100 format.
The test compares any written data with the subsequent bytes in the
reference file. The test supplies any read data from the subsequent
bytes in the reference file.
A reference file can be created from the debug output at level 5
when reading an actual globalsat device:
egrep 'Receiving|Sent' "$log" | sed 's/^Sent: //' | sed 's/^Receiving //' \
| sed 's/RX:.*//' | xxd -r -p > "$log".bin
This creates a binary file from all the bytes transferred to or
from the device.
* update serialization reference files.
Even though the dg100 regression formats are internal, they still
get serialized. The GUI ignores them.
* Fix memory leak exposed by new dg100 regression test.
By using QList instead of homegrown dynarray16 class.
tsteven4 [Thu, 7 May 2020 12:31:39 +0000 (06:31 -0600)]
fix nmea writer date bug. (#553)
* fix nmea writer date bug.
dates before 2000 were written with a month off by one.
This also changes the behavior when the creation time is invalid.
Previously you would get data related to the unix epoch for the date
and time fields.
Now you get empty fields, i.e. ",,"
* fix magellan writer date bug.
This had the same bug as nmea. It had an additional bug
when it attempted to round the fractional part of a second. Rounding
can ripple all the way from the fractional part of a second to the year,
as is now demonstrated in the testcase.
Like nmea, magellan will now print empty fields if the creation time
is invalid.
* fix date bug in gpssim.
This is the same bug as in nmea, magproto.
tsteven4 [Mon, 4 May 2020 19:20:22 +0000 (13:20 -0600)]
convert unicsv to Format class (#552)
* convert unicsv to Format class.
Two bugs are fixed as well:
1. { "datum", fld_date, STR_ANY } is removed from the fields_def.
Note that the type is fld_date. I don't think this was ever used.
We do have the datum option to set the datum from the command line.
2. unicsv_fondle_header changed the fields_def type to fld_iso_time
if it was fld_time or fld_date and the value contained "iso".
However, fields_def isn't used outside unicsv_fondle_header, so
this had no effect.
* update dependencies.
tsteven4 [Fri, 1 May 2020 22:12:29 +0000 (16:12 -0600)]
fix windows issues with kml.h including windows.h (#551)
windows.h defines macros for max and min, which lead to compiler
warnings:
random.h(125): warning C4003: not enough arguments for function-like macro invocation 'max' (compiling source file
kml hasn't needed windows.h since
ea82fa6d6
tsteven4 [Fri, 1 May 2020 13:03:31 +0000 (07:03 -0600)]
convert kml to Format class (#550)
* convert kml to Format class.
* update dependencies.
* restore kml real time postion writer functionality.
and have it produce valid kml.
Add a test case.
* correct new kml test reference file name.
tsteven4 [Fri, 1 May 2020 12:32:18 +0000 (06:32 -0600)]
add recoverymode and CRC checking to FIT reader. (#549)
* add recoverymode and CRC checking to FIT reader.
If present, the header CRC is checked.
The file CRC and length is checked.
A recoverymode option is added.
In the default mode we will fatal with:
a bad CRC,
a bad endian field,
an attempt to read when the data section doesn't have sufficient data,
an unexepected EOF.
In recovery mode when we encounter one of these errors we will abort
read processing and continue. This allows a more immediate cleaner
exit from the reader while still allowing any writer to use data that
was recovered previous to the read abort.
* add further explanation of recoverymode for document.
* make sure garmin fit messages are defined before being used.
tsteven4 [Tue, 28 Apr 2020 12:46:14 +0000 (06:46 -0600)]
sprintf/snprintf replacements (#548)
* fix g++ 9.3 warnings about snprintf.
These appear at -O2.
* handle garmin category conversion similar to garmin_fs.cc
* fix stmwpp includes under configure.
tsteven4 [Tue, 28 Apr 2020 12:42:48 +0000 (06:42 -0600)]
introduce xasprintf that accepts a QScopedPointer& (#547)
and use it to fix gcc 9 warnings in magproto, as well as other
possible string truncations/overflows.
tsteven4 [Fri, 24 Apr 2020 15:48:42 +0000 (09:48 -0600)]
migrate advanced travis build to focal. (#546)
and fix a new clazy warning. This warning shows up on focal
with clazy 1.6, but not on eoan with clazy 1.5.
tsteven4 [Tue, 21 Apr 2020 20:38:47 +0000 (14:38 -0600)]
convert garmin_fit to Format class. (#544)
Additionally, modernize fit reader:
use a container to hold field information for a message.
pass fit fields and message defs by const reference.
tsteven4 [Tue, 21 Apr 2020 00:32:02 +0000 (18:32 -0600)]
add missing include file to build.
tsteven4 [Sun, 19 Apr 2020 20:44:43 +0000 (14:44 -0600)]
improve MSVC 2015 workaround. (#543)
tsteven4 [Sat, 18 Apr 2020 12:34:39 +0000 (06:34 -0600)]
convert subrip, energympro, globalsat_sport to Format class (#542)
* convert subrip, energympro, globalsat_sport to Format.
* update dependencies in Makefile
tsteven4 [Sat, 18 Apr 2020 12:17:27 +0000 (06:17 -0600)]
update linux/macos CI Qt 5.12.8 (#541)
* update CI to 5.12.8 (except appveyor)
we use the appveyor installed Qt 5.12, which is currently
5.12.6.
* update travis yaml syntax.
* update macos build system for Qt 5.12 build.
* try osx_image: xcode11.3
osx_image xcode10.3 failed 3 times in a row. It showed an
incomplete Qt install and repeated attempts to detatch.
* debug macos qt install fails
* Revert "debug macos qt install fails"
This reverts commit
36df50bc865b515b4545f5f25cc65f5e0575d325.
* Revert "try osx_image: xcode11.3"
This reverts commit
ff1e803234b31671e77d8d9ca68e74d62e753b80.
* Revert "update macos build system for Qt 5.12 build."
This reverts commit
efedf5132a84141ae351cfe308433bfbda53374b.
* cleanup new docker script.
* build docker image in clean directory.
* move macos Qt 5.12 build to xcode 10.3.
This includes a workaround for a bug in the Qt intaller
that causes segmentation faults in the Qt installer when
the minimal platform is used on macos 10.14, 10.15.
tsteven4 [Fri, 17 Apr 2020 12:28:34 +0000 (06:28 -0600)]
assume energympro and globalsatsport use LocalTime. (#447)
* assume energympro and globalsatsport use LocalTime.
add an option to set the timezone for these formats, as the
timezone used to create the data may not match the timezone of the
computer reading the data.
* modify energympro/globalsatsport tests to use
UTC offsets. Europe/Stockholm wasn't available on our Docker
bionic test image.
* util.cc build fix
include QTimeZone, dropped in manual merge
* Fix build error in util.cc
Lazy conflict merging.
* modify serialization ref files for new option.
* make new var static in energympro.
Co-authored-by: GPSBabel <gpsbabel@users.noreply.github.com>
Pierre Bernard [Fri, 17 Apr 2020 12:17:18 +0000 (14:17 +0200)]
Added support for Qstarz BL-1000 .BIN files (#515)
* Added support for Qstarz BL-1000 .BIN files
* Use FormatSpecificData
* Updates based on pull request comments
* Remove executable bit on Qstarz sample file
* include-what-you-use headers
* Added format documentation for qstarz_bl_1000
Co-authored-by: gloubibou <pierre.bernard@web.de>
tsteven4 [Thu, 16 Apr 2020 22:06:03 +0000 (16:06 -0600)]
A variety of loose ends (#540)
* misc cleanups.
clang-tidy found the Qstring passed by value.
Attempting to build the GUI without webengine or webkit with Qt 5.15
found the missing QT module (widgets) in app.pro. It is required by QDialog.
* fiddle with document recipes.
add qmake target to generate gpsbabel.pdf.
drop --load-trace xsltproc options when building document.
set logging level for fop to WARN
by creating $HOME/.foprc if it doesn't exist.
fop doens't have the ability to override this on the command line.
* use .foprc in build tree.
This solves the issue on travis the $HOME doesn't exist.
It also avoids writing to the users home directory.
* fiddle with configure.
* filter with doc version stuff.
tsteven4 [Wed, 15 Apr 2020 13:59:39 +0000 (07:59 -0600)]
Fallthrough corrections (#538)
* fix an actual bug found by Wimplicit-fallthrough=
* add comments for gcc wrt Wimplicit-fallthrough=
The real fix is the to add the attribute [[fallthrough]];
which was added in c++17.
gcc accepts this, but until c++17 there wasn't
a requirement to ignore unrecognized attributes, so we can
imagine a pre c++17 compiler might choke on it.
tsteven4 [Tue, 14 Apr 2020 21:33:19 +0000 (15:33 -0600)]
Fix access to QByteArray/QString outside the valid range. (#537)
With Qt 5.15, and likely 5.14, the following warnings were generated during
testo:
Using QByteRef with an index pointing outside the valid range of a QByteArray. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Note this requires Qt to be compiled for debug.
These warnings can be debugged by running testo with
"export QT_FATAL_WARNINGS=1" to generate core dumps.
I suspect the appending of null terminators in ggv_bin is unecessary,
i.e. I beleive QByteArray::resize() in ggv_bin_read_bytes will take
care of this. Never the less I slavishly kept adding them just to make
certain.
tsteven4 [Mon, 13 Apr 2020 14:36:32 +0000 (08:36 -0600)]
rework subrip format synchronization. (#536)
* rework subrip format synchronization.
support subsecond synchronization.
validate option input.
add debug messages for synchronization.
correct option text for GUI.
* update serialization reference files for corrected subrip help.
tsteven4 [Mon, 13 Apr 2020 14:27:57 +0000 (08:27 -0600)]
Generalize xmlgeneric callbacks (#532)
generalize callbacks for xmlgeneric.
use newly available pointer to data member callbacks to restore
yahoo functionality.
add a yahoo test.
.
add xml_init method to automatically generate Functors.
tsteven4 [Wed, 8 Apr 2020 12:20:52 +0000 (06:20 -0600)]
improve kml reader speed 5.1x. (#531)
tsteven4 [Sun, 5 Apr 2020 22:31:23 +0000 (16:31 -0600)]
Optimize QString usage in gpx format. (#530)
Don't convert QStringRef to QString unecessarily.
Use QLatin1String, QStringLiteral.
A 18% performance improvement has been measured with
gpxbabel -f lowrance-v4.gpx -o lowranceusr,wversion=4 -F lowrance-v4.usr
valgrind --tool=callgrind was useful. Further improvements in the
reader are likely to be found in xml_parse_time.
tsteven4 [Fri, 3 Apr 2020 21:41:40 +0000 (15:41 -0600)]
Lowranceformat (#529)
* convert lowranceusr format to Format class.
* fix lowranceusr linking issues on some platforms.
* workaround MSVC2015 C2373 errors with constexpr static arrays.
* try harder to work around MSVC2015 C2373.
* tweak lowrancusr
tsteven4 [Tue, 31 Mar 2020 22:40:22 +0000 (16:40 -0600)]
convert random format to Format class. (#528)
tsteven4 [Mon, 30 Mar 2020 20:14:57 +0000 (14:14 -0600)]
convert nmea format to Format class. (#524)
tsteven4 [Fri, 27 Mar 2020 22:29:14 +0000 (16:29 -0600)]
migrate to travis-ci.com (#526)
* get qt installs working to load cache.
* update to travis-ci.com for github release build log links.
tsteven4 [Fri, 27 Mar 2020 20:19:40 +0000 (14:19 -0600)]
update Dockerfiles to use webengine instead (#525)
of webkit.
tsteven4 [Thu, 26 Mar 2020 22:05:36 +0000 (16:05 -0600)]
work around DG-100 getconfig issues (#519)
* work around dg-100 getconfig issues.
Don't issue the getconfig command on the DG-100. Different DG-100
devices seem to return different numbers of bytes, which leads
to checksum errors, which we treat as fatal. Before release
1.5.1 we didn't issue this command. It was apparently added because
it changed the status light to green on the DG-200.
* restore unintended whitespace change.
tsteven4 [Thu, 26 Mar 2020 16:56:57 +0000 (10:56 -0600)]
make some geojson member functions private. (#523)
tsteven4 [Thu, 26 Mar 2020 14:04:08 +0000 (08:04 -0600)]
convert geojson format to Format class. (#522)
* convert geojson format to Format class.
use gpsbable::File instead of QFile for input. This results in
better error messages.
use gpsbabel::File for output instead of gbfile.
* detect and log parser errors in geojson reader.
tsteven4 [Mon, 23 Mar 2020 17:20:35 +0000 (11:20 -0600)]
fix gtm writer issue with empty tracks. (#521)
This format expects one track style entry for each tracklog entry
with the tracklog flag set. If the tracklog flag is set it indicates the
start of a new track. Each tracklog entry represents a point.
Thus, it is not possible to represent a track without any points in this
format.
This change prevents the writing of track style entries for tracks that
don't have any points.
Previously, this could cause counts from test-all in the category
"tests without error but with unexpected output" if the refernce file
had tracks with no points.
GPSBabel [Thu, 19 Mar 2020 01:34:54 +0000 (20:34 -0500)]
Merge pull request #518 from gpsbabel/kmlfencepost
Let KML <TimeSpan> interpolation not count the ending fencepost
tsteven4 [Wed, 18 Mar 2020 18:50:04 +0000 (12:50 -0600)]
modernize radius filter ... (#511)
* modernize radius filter ...
and fix a memory leak when maxcount option discards wpts.
* radius loop safety.
* allow any Comparable with Waypoint/Route List sort.
* use static_cast instead of reinterpret_cast to
recover original type from void*.
tsteven4 [Wed, 18 Mar 2020 13:13:05 +0000 (07:13 -0600)]
CLI renamed to gpsbabel on all builds. (#520)
This chases some lose ends from
23379e741bf98603a5737e6f36422b753fc4bbdb
Robert Lipe [Mon, 16 Mar 2020 10:06:27 +0000 (05:06 -0500)]
Suspend uploading to transfer.sh. Sites refer to it as "now broken" and
"pending sale". My own testing shows that it saturates all the sockets for
a connection and dies with zero bytes transferred. Build server is about the
same.
This is a mechanical side-port of
33085422627563885c59e60d47d1c9085f48e9a4
which went to the trunk instead of the branch, wheree it'sn needed. Same code
Robert Lipe [Mon, 16 Mar 2020 09:47:25 +0000 (04:47 -0500)]
Suspend uploading to transfer.sh. Sites refer to it as "now broken" and
"pending sale". My own testing shows that it saturates all the sockets for
a connection and dies with zero bytes transferred. Build server is about the
same
Robert Lipe [Fri, 13 Mar 2020 08:18:07 +0000 (03:18 -0500)]
Fix generated IGC file to refelect recent change in our KML reader.
GPSBabel [Fri, 13 Mar 2020 05:48:44 +0000 (00:48 -0500)]
Merge pull request #514 from tsteven4/simplifyopt3
optimize simplify filter.
Robert Lipe [Fri, 13 Mar 2020 05:35:53 +0000 (00:35 -0500)]
Dont count ending fencepost when interpolating TimeSpan in KML reader.
Robert Lipe [Fri, 13 Mar 2020 05:21:39 +0000 (00:21 -0500)]
Make command line version lower case only - everywhere.
tsteven4 [Wed, 26 Feb 2020 01:53:32 +0000 (18:53 -0700)]
optimize simplify filter.
drop unused member ordinal from xte struct. This, and changes in
the implementation of shuffle_xte,
result in a ~13% speed improvement for long routes.
use new/delete instead of *alloc/free.
provide initializers for all data members.
use strtol instead of atol.
update casting to c++.
tsteven4 [Mon, 24 Feb 2020 18:22:16 +0000 (11:22 -0700)]
make shape a subclass of Format. (#512)
* make shape a subclass of Format.
* correct type of 2nd param passed to SHPCreateSimpleObject
tsteven4 [Thu, 20 Feb 2020 14:53:15 +0000 (07:53 -0700)]
use initializer list to construct gpx tag hash. (#509)
tsteven4 [Thu, 20 Feb 2020 14:48:28 +0000 (07:48 -0700)]
update format specific handling. (#502)
* update format specific handling.
Format specific allocate, copy, destroy functions use new/delete for
underlying data management. Use brace intitializers for underlying
data. Previous xmalloc/xcalloc and xfree were used.
Format specific copy functions use copy constructor of underlying data.
Format specific copy functions have a const source.
Format specific functions use static_cast instead of c-style casts.
This helps avoid casting away const accidentally.
When possible, assign the result of fs_chain_find to a const pointer.
Eliminate corruption of global lists by AN1 writer which was modifying
format specific data. This also simplifies memomry management and
fixes a double delete.
Fix const correctness issues with an1 symbol lookup.
Correct an1 symbol lookup to avoid dependency on structure padding.
Catch make-an1sym.pl with an1sym.h.
* use reinterpret_cast w/ fs_chain_add fs_chain_find ...
instead of c-style casts.
* make format_specifc_data a base class
and the various flavors derived classes.
* use a QList for format_specific_data chains.
* split format specific defines ...
use reinterpret_cast to downcast format_specific_data. dynamic_cast
is noticeably slower.
* add new formspec.h file.
* create FormatSpecificDataList class.
rename format specific related items.
* safety check for formspec nullptr function ptrs.
* replace format specific function pointers
with pure virtual clone function and dtor.
tsteven4 [Wed, 19 Feb 2020 20:35:59 +0000 (13:35 -0700)]
extend travis cache expiration date. (#510)
Robert Lipe [Sun, 16 Feb 2020 06:30:23 +0000 (00:30 -0600)]
More thoroughly hide clearly broken code that should exist only on a branch
that seeped into master when I added an epmpty file.
Robert Lipe [Sun, 16 Feb 2020 05:04:59 +0000 (23:04 -0600)]
Remove debugging.
Robert Lipe [Sun, 16 Feb 2020 05:03:24 +0000 (23:03 -0600)]
Delete debuging from yahoo.
Robert Lipe [Sun, 16 Feb 2020 04:55:38 +0000 (22:55 -0600)]
Something empty to force a codacy push.
Robert Lipe [Sun, 16 Feb 2020 04:55:00 +0000 (22:55 -0600)]
Merge branch 'master' of https://github.com/gpsbabel/gpsbabel
tsteven4 [Sat, 15 Feb 2020 22:37:45 +0000 (15:37 -0700)]
retire route_head_alloc(). (#507)
tsteven4 [Sat, 15 Feb 2020 19:26:44 +0000 (12:26 -0700)]
reference file relocation. (#506)
move geocaching.loc into reference directory.
use ${REFERENCE} to find reference files. not reference. not nothing.
Ralf Horstmann [Fri, 14 Feb 2020 20:09:38 +0000 (21:09 +0100)]
Implement GCID parsing in unicsv and extend ID to 64bit (#501)
* Implement GCID parsing in unicsv and extend ID to 64bit
This reimplements the parser and adds some test cases. The test
cases have been validated with several online converters, so this
hopefully works better than the previous implementation.
This also fixes an endless loop that afl managed to trigger.
* Fix clazy warning in unicsv
* Add GC-ID test cases, documentation, int parsing
- Explicitly do the integer parsing with base 10, otherwise hex
values and octal values would be accepted with 0x and 0 prefix.
- Add testcases that cover GC-ID parsing, including some invalid cases
- Unify the terminology (GC-Code vs GC-ID)
- Add examples to the unicsv documentation showing that both GC-ID
and GC-Code are accepted
tsteven4 [Thu, 13 Feb 2020 14:51:34 +0000 (07:51 -0700)]
warning fixes (#505)
* fix some qt deprecations and a warning.
* fix fixes.
* fix comment
tsteven4 [Wed, 12 Feb 2020 18:01:53 +0000 (11:01 -0700)]
use standard bionic image for travis coverage build. (#504)
Ralf Horstmann [Wed, 12 Feb 2020 16:19:01 +0000 (17:19 +0100)]
Some more fixes for issues found by afl/asan (#500)
* Fix uninitialized warning in lowranceusr
* Fix stack buffer overlow in lowranceusr
%15.10f may produce more characters than what fits into the
buffer of 32 bytes. Use std::isnan to avoid the sprintf.
==
2133227==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff9bab5b20 at pc 0x7fc83fd95865 bp 0x7fff9bab57e0 sp 0x7fff9bab4f70
WRITE of size 38 at 0x7fff9bab5b20 thread T0
#0 0x7fc83fd95864 in vsprintf (/lib64/libasan.so.5+0x9e864)
#1 0x7fc83fd95d1e in sprintf (/lib64/libasan.so.5+0x9ed1e)
#2 0x767bbb in lowranceusr_parse_waypt /home/gpsbabel/gpsbabel.git/lowranceusr.cc:813
#3 0x77be54 in lowranceusr_parse_waypts /home/gpsbabel/gpsbabel.git/lowranceusr.cc:1116
#4 0x781151 in data_read /home/gpsbabel/gpsbabel.git/lowranceusr.cc:1658
#5 0xc7ac71 in run /home/gpsbabel/gpsbabel.git/main.cc:339
#6 0x4cdd62 in main /home/gpsbabel/gpsbabel.git/main.cc:707
#7 0x7fc83f29d1a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
#8 0x4cef7d in _start (/home/gpsbabel/gpsbabel.git/gpsbabel+0x4cef7d)
* Ensure string is terminated mps_readstr in mapsource
When EOF or buffer limit is reached, the return buffer might not be
zero-terminated. So add termination at the end of the buffer and read
max sz - 1 bytes from file instead of sz bytes.
==
2145172==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd2ba34e00 at pc 0x7f005812dbbd bp 0x7ffd2ba34860 sp 0x7ffd2ba34008
READ of size 1028 at 0x7ffd2ba34e00 thread T0
#0 0x7f005812dbbc (/lib64/libasan.so.5+0x67bbc)
#1 0x557c62 in QString::fromUtf8(char const*, int) /usr/include/qt5/QtCore/qstring.h:572
#2 0x557c62 in QString::operator=(char const*) /usr/include/qt5/QtCore/qstring.h:706
#3 0x557c62 in mps_waypoint_r /home/gpsbabel/gpsbabel.git/mapsource.cc:571
#4 0x55edd4 in mps_read /home/gpsbabel/gpsbabel.git/mapsource.cc:1675
#5 0xc7adb1 in run /home/gpsbabel/gpsbabel.git/main.cc:339
#6 0x4ce082 in main /home/gpsbabel/gpsbabel.git/main.cc:707
#7 0x7f005766c1a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
#8 0x4cf29d in _start (/home/gpsbabel/gpsbabel.git/gpsbabel+0x4cf29d)
Address 0x7ffd2ba34e00 is located in stack of thread T0 at offset 1344 in frame
#0 0x556e8f in mps_waypoint_r /home/gpsbabel/gpsbabel.git/mapsource.cc:507
This frame has 6 object(s):
[48, 56) 'wptdesc' (line 538)
[80, 88) '<unknown>'
[112, 120) '<unknown>'
[144, 152) '<unknown>'
[176, 276) 'tbuf' (line 508)
[320, 1344) 'wptname' (line 509) <== Memory access at offset 1344 overflows this variable
* Fix off-by-one list access in pcx reader
* Prevent stack based buffer overflow in gdb reader
* Prevent global buffer overflow in garmin_fit
The message_def array is 16 bytes long, make sure local_id stays
within range, same as in other places in garmin_fit.
Found by afl which managed to create a call to fit_parse_data_message
with a header value of 0x1f:
==
2927747==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000010a3bd8 at pc 0x000000a91bba bp 0x7ffd82584a90 sp 0x7ffd82584a80
READ of size 4 at 0x0000010a3bd8 thread T0
#0 0xa91bb9 in fit_parse_data /home/gpsbabel/gpsbabel.git/garmin_fit.cc:549
#1 0xa92ae3 in fit_parse_data_message /home/gpsbabel/gpsbabel.git/garmin_fit.cc:821
#2 0xa92ae3 in fit_parse_record /home/gpsbabel/gpsbabel.git/garmin_fit.cc:864
#3 0xa92ae3 in fit_read /home/gpsbabel/gpsbabel.git/garmin_fit.cc:884
#4 0xc7cdb1 in run /home/gpsbabel/gpsbabel.git/main.cc:339
#5 0x4ce142 in main /home/gpsbabel/gpsbabel.git/main.cc:707
#6 0x7f4f3b2651a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
#7 0x4cf35d in _start (/home/gpsbabel/gpsbabel.git/gpsbabel+0x4cf35d)
tsteven4 [Sun, 9 Feb 2020 19:36:54 +0000 (12:36 -0700)]
Rework interpolate filter, retire some magic numbers. (#498)
* rewrite interpolate filter.
What started out as an investigation of a clang-tidy warning about
a floating point loop counter (FloatLoopCounter, cert-flp30-c)
turned into this.
Use integer loop counters.
Use a variable step size, that is constant for each span, to meet the
constraint of no interval > limit.
Previously steps of the limit size were used leaving the last step in
a span of a different likely shorter size.
Be defensive about user input and track/route input, no more infinite
loops for negative time limits.
Support milliseconds.
Reduce duplication.
Enhance test to more easily verify interpolation steps.
More efficient route list maniupulation.
Correct documentation.
Correct signed literals use with the unsigned argtype.
This does reiterate, but not fix, the deficiency in route_head copying
that recently came up where new members of route_head are not copied.
* correct test to use long long format for TIMET_TIME_MS.
* Eliminate some magic numbers for unit conversion.
Previously the conversion factor for meters to feet was inaccurate. Correcting
this caused a couple kml test cases to change.
The ozi test was problematic, an altitiude was provided that endend in
0.5 feet, and was printed out rounded to feet. A one bit error in the
mantissa of the double involved in the round trip to meters could change
the rounding result. To fix this the ozi writer was changed to print
track altitudes to a tenth of a foot. This matches an ozi track file found in
the wild as well as our own ozi track sample.
The classic-2 test involving gnuplot.style printed altitude to one millonth
of a foot, i.e. 0.3 micrometers! The gnu plot style was changed to print
to the thousandth of a foot, i.e. 0.3 millimeters.
Ralf Horstmann [Sun, 9 Feb 2020 17:02:34 +0000 (18:02 +0100)]
Some fixes for issues found with afl and address sanitizer (#499)
* Fix off-by-one in nmea reader
Found with afl and address sanitizer:
AddressSanitizer:DEADLYSIGNAL
=================================================================
==
2615627==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f54eaa53683 bp 0x7ffd187eed00 sp 0x7ffd187ee4b8 T0)
==
2615627==The signal is caused by a READ memory access.
==
2615627==Hint: address points to the zero page.
#0 0x7f54eaa53682 in QString::chop(int) (/lib64/libQt5Core.so.5+0x13c682)
#1 0x5e8d7f in gpgsa_parse /home/gpsbabel/gpsbabel.git/nmea.cc:744
#2 0x5e8d7f in nmea_parse_one_line /home/gpsbabel/gpsbabel.git/nmea.cc:1021
#3 0x5f0b6f in nmea_read /home/gpsbabel/gpsbabel.git/nmea.cc:1096
#4 0xc7e483 in run /home/gpsbabel/gpsbabel.git/main.cc:339
#5 0x4ced15 in main /home/gpsbabel/gpsbabel.git/main.cc:707
#6 0x7f54ea3f71a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
#7 0x4cffdd in _start (/home/gpsbabel/gpsbabel.git/gpsbabel+0x4cffdd)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libQt5Core.so.5+0x13c682) in QString::chop(int)
==
2615627==ABORTING
* Fix heap buffer overflow in igc reader
In gbfgetstr(), when file->buff contains exactly file->buffsz
characters including null termination, there is no room to
append another character with strcat() in igc.cc
Found by afl with address sanitizer:
==
2082077==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x611000001f40 at pc 0x7f5a4e0da6cd bp 0x7ffd14ffe040 sp 0x7ffd14ffd7e8
WRITE of size 2 at 0x611000001f40 thread T0
#0 0x7f5a4e0da6cc (/lib64/libasan.so.5+0x9b6cc)
#1 0x7327cf in data_read /home/gpsbabel/gpsbabel.git/igc.cc:334
#2 0xc7a3c1 in run /home/gpsbabel/gpsbabel.git/main.cc:339
#3 0x4cddf2 in main /home/gpsbabel/gpsbabel.git/main.cc:707
#4 0x7f5a4d5e51a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
#5 0x4cf00d in _start (/home/gpsbabel/gpsbabel.git/gpsbabel+0x4cf00d)
0x611000001f40 is located 0 bytes to the right of 256-byte region [0x611000001e40,0x611000001f40)
* Fix endless loop in mapsource
The loop around gbfread needs a check for eof, otherwise it
may never terminate with special input created by afl.